# the minimum version of CMake.
cmake_minimum_required(VERSION 3.5.0)
project(json_utils)

SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG")
set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})

if(DEFINED PACKAGE_FIND_FILE)
    include(${PACKAGE_FIND_FILE})
endif()

include_directories(${NATIVERENDER_ROOT_PATH}
                    ${NATIVERENDER_ROOT_PATH}/include
                    ${NATIVERENDER_ROOT_PATH}/yyjson)

# 收集所有源文件
file(GLOB_RECURSE SOURCE_FILES
    "${NATIVERENDER_ROOT_PATH}/napi_init.cpp"
    "${NATIVERENDER_ROOT_PATH}/src/*.cpp"
    "${NATIVERENDER_ROOT_PATH}/yyjson/yyjson.c"
)

add_library(hmserializationjson SHARED ${SOURCE_FILES})
target_link_libraries(hmserializationjson PUBLIC libace_napi.z.so)
